package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.example.entity.Asset;

import java.util.List;
import java.util.Map;

/**
 * @Description
 * @Author 魏锴
 * @Date 2024/1/13
 */
public interface AssetMapper extends BaseMapper<Asset> {
    boolean insertAsset(Asset asset);

    boolean updateAsset(Asset asset);

    boolean deleteAsset(int id);
    Asset getAssetById(int id);

    List<Asset> getAssetList(@Param("name") String name, @Param("category") String category,
                             @Param("label") String label, @Param("orgIds") int[] orgIds);

    String getMaxAssetNo();

    @MapKey("id")
    List<Map<String, Integer>> getOrgList();

    @MapKey("id")
    List<Map<String, Integer>> getOrgListWithFather();

}
